package com.example.testlib

fun printGoodMorning(){
    println("早上好~")
}

// 伴生对象
class StringUtils {
    companion object {
        // 伴生对象实现静态变量
        val TAG = "StringUitls"
        // 伴生对象实现静态方法
        fun isEmpty(str: String) : Boolean {
            return "" == str
        }
    }
}


// 单例实现
class SingleInstance private constructor() {
    companion object {
        fun get() : SingleInstance {
            return Holder.instance
        }
    }

    private object Holder {
        val instance = SingleInstance()
    }
}